﻿using System.Collections.ObjectModel;
using System.Diagnostics;
using Microsoft.Practices.Prism.Commands;

namespace KlavoNotifications.ViewModels.MainWindow
{
    public class GameItemViewModel
    {
        private readonly DelegateCommand _navigateCommand;

        public GameItemViewModel()
        {
            Players = new ObservableCollection<PlayerItemViewModel>();    

            _navigateCommand = new DelegateCommand(NavigateCommandExecuted);
        }        

        public string Timeout { get; set; }
        public string Type { get; set; }
        public string Gametype { get; set; }
        public string Voc { get; set; }
        public string Competition { get; set; }
        public string Mode { get; set; }
        public string Begintime { get; set; }
        public string Allowed { get; set; }
        public string Url { get; set; }

        public string Value { get; set; }

        public ObservableCollection<PlayerItemViewModel> Players { get; set; }

        public DelegateCommand NavigateCommand
        {
            get { return _navigateCommand; }
        }

        private void NavigateCommandExecuted()
        {
            Process.Start(new ProcessStartInfo(Url));
        }        
    }
}